
/**
*  \file DemodulatorDelete.c
*  \brief �ͷŽṹ�嶯̬�ڴ�.
*/
#include"../../head/DemodulatorStruct.h"
/**
*  \brief   �ͷŽṹ�嶯̬�ڴ�.
*
*  \param [in]  DemodulatorS                       �洢ÿ��ģ���ṹ��ָ���Ľṹ��.
*  \param [in]  Probe                              �洢ÿһ��ÿһ��ģ�鴦�������ݵĽṹ��.
*  \param [in]  MudSig                             �洢����ͨ�����ཬ�������ݵĽṹ��.
*  \param [in]  DemodParam                         �洢�ⲿ�ӿڲ������ݵĽṹ��.
*  \return                                         Empty
*
*/
/*lint -e438*/   //Warning 438: Last value assigned to variable �������ĸ����� (defined at line 28 - 35) not used
void  DemodulatorDelete(PtrDemodulatorStruct DemodulatorS, PtrProbe Probe, PtrMudSig MudSig, PtrDemodParam DemodParam, unsigned int ModuleEnableStatus)
{
	//ǰ���˲�ģ���ṹ���ͷ�
    FREE(DemodulatorS->PreFilterStruct);
    FREE(DemodulatorS->PreFilterStruct1);
	
	//��ֵ�˲���ģ���ṹ���ͷ�
 	FREE(DemodulatorS->MedFilterStruct->Z);
    //FREE(DemodulatorS->MedFilterStructRef->Z);//2022.06.08��ֵע��
 	FREE(DemodulatorS->MedFilterStruct);
 	FREE(DemodulatorS->MedFilterStructRef);

//	//������������ģ���ṹ���ͷ�
//	if (GETBIT(ModuleEnableStatus, C_MODULESW_SSNC_Method_BIT))			//! �޸�20191111		�������뷽��λ�ͷ��ڴ�
//	{
//		DeleteSSNCStruct(DemodulatorS->SSNC_AF_Struct);
//	}
//	else
//	{
//		FREE(DemodulatorS->SSNC_DFT_Struct);
//		FREE(DemodulatorS->FrequencyComponent);
//	}

	//����Ƶ�ʲ���ģ���ṹ���ͷ�
//	FREE(DemodulatorS->FpumpMeasureStruct->SigBuf->Signal);
//	FREE(DemodulatorS->FpumpMeasureStruct->SigBuf);
//	FREE(DemodulatorS->FpumpMeasureStruct);

	//�źų�ȡģ���ṹ���ͷ�
	FREE(DemodulatorS->DecimatorStruct);
    FREE(DemodulatorS->DecimatorStruct1);

//	//chirp����ģ��
//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpCorrFilt->b);
//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpCorrFilt->z);
//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpCorrFilt);

//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpPeakDetFilt->b);
//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpPeakDetFilt->z);
//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpPeakDetFilt);

//	FREE(DemodulatorS->ChirpDetectionStruct->lpFilt->b_real);
//	FREE(DemodulatorS->ChirpDetectionStruct->lpFilt->b_imag);
//	FREE(DemodulatorS->ChirpDetectionStruct->lpFilt->z_real);
//	FREE(DemodulatorS->ChirpDetectionStruct->lpFilt->z_imag);
//	FREE(DemodulatorS->ChirpDetectionStruct->lpFilt);

//	FREE(DemodulatorS->ChirpDetectionStruct->ChirpDetBuf);

//	FREE(DemodulatorS->ChirpDetectionStruct);
	
	//��������ģ���ṹ���ͷ�
	FREE(DemodulatorS->BPSK_DemodStruct->LPF->b);
	FREE(DemodulatorS->BPSK_DemodStruct->LPF->ZI);
	FREE(DemodulatorS->BPSK_DemodStruct->LPF->ZQ);
	FREE(DemodulatorS->BPSK_DemodStruct->LPF);
	FREE(DemodulatorS->BPSK_DemodStruct);

	//FARROW�ṹ��ֵ�˲����ṹ���ͷ�
	FREE(DemodulatorS->ModuleStructFSRC);

	//�ز�ͬ��ģ���ṹ���ͷ�
    //FREE(DemodulatorS->CarrierDPLLStruct);

	//֡ͬ��ģ���ṹ���ͷ�
	FREE(DemodulatorS->ModuleStructFrameSync->TrainingSeqLoc);
	FREE(DemodulatorS->ModuleStructFrameSync->SeqInputBuf);
	FREE(DemodulatorS->ModuleStructFrameSync->SigDelayBuf);
	FREE(DemodulatorS->ModuleStructFrameSync->TrainingSeqCorrBuf);
	FREE(DemodulatorS->ModuleStructFrameSync);
	

	//����ģ���ṹ���ͷ�
	FREE(DemodulatorS->ModuleStructFrameSyncBuf);
	FREE(DemodulatorS->ModuleStructEq);

	FREE(DemodulatorS);

	//Probe�ṹ��
    FREE(Probe->SigBB);
	FREE(Probe->SigBB_Frw);
	FREE(Probe->SigMedFilt);
//	FREE(Probe->SigMedFiltRef);
	FREE(Probe->SigPreFilt);
//	FREE(Probe->SigPreFiltRef);
//	FREE(Probe->PreFiltOutPS);
	FREE(Probe->SignalDenoise);
//	FREE(Probe->SignalDenoiseRef);
    FREE(Probe->MseqCorrOut);
	FREE(Probe->SyncedSigOut);
	FREE(Probe->FrameSyncSig);
	FREE(Probe->CarrierLocI);
	FREE(Probe->CarrierLocQ);
	FREE(Probe->SigBB_AFC);
	FREE(Probe->EqSig);
	FREE(Probe->DecData);
	FREE(Probe->EqErr);

	FREE(Probe);
	
	//DemodParam�ṹ��
	FREE(DemodParam->TRAINING_SEQ);
	FREE(DemodParam);

	//�ཬ�������ݽṹ��
    //FREE(MudSig->Pri);
    //FREE(MudSig->Ref);
	FREE(MudSig);

}  /*lint +e438*/
